import http from "../config/http-config"


const request = (url, method, param, config)=>{
  if(!config){config = {}}
  if('get' == method.toLocaleLowerCase()){
    return http.get(url, {params: param, ...config})
  }else if('post' == method.toLocaleLowerCase()){
    return http.post(url, param, config)
  }
}

export {
  request
}

export function groupByDay(param){
  return request("/pachong/dayStatics", 'get', param)
}

export function groupByDayAndCollege(param){
  return request("/pachong/dayCollegeStatics", 'get', param)
}

export function groupByCollege(param){
  return request("/pachong/collegeStatics", 'get', param)
}

// 热词
export function cloudData(param){
  return request("/pachong/wordCloudList", 'post', param)
}

// 详细信息
export function detailList(param){
  return request("/pachong/getDetailList", 'post', param)
}

// top100 来源
export function topSource(param){
  return request("/pachong/collegeTop", 'get', param)
}

// top 100下载
export function topDownload(param){
  return request("/pachong/downloadTop", 'get', param)
}
// 各专业占比
export function topType(param){
  return request("/pachong/typeCount", 'get', param)
}
